<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Radcodes
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */

class Radcodes_AdminSettingsController extends Core_Controller_Action_Admin {
	public function indexAction() {
		$this->view->navigation = $navigation = Engine_Api::_ ()->getApi ( 'menus', 'core' )->getNavigation ( 'radcodes_admin_main', array (), 'radcodes_admin_main_settings' );
		
		$this->view->form = $form = new Radcodes_Form_Admin_Global ();
		
		if ($this->getRequest ()->isPost () && $form->isValid ( $this->getRequest ()->getPost () )) {
			$values = $form->getValues ();
			
			foreach ( $values as $key => $value ) {
				Engine_Api::_ ()->getApi ( 'settings', 'core' )->setSetting ( $key, $value );
			}
		
		}
	
	}

}